package com.pkk.penguin.frame.know.java.driven.ext.listener;

import com.pkk.penguin.frame.know.java.driven.ext.listener.event.MyEvent1;
import com.pkk.penguin.frame.know.java.driven.ext.listener.listener.MyApplicationListener;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 事件监听主测试类
 *
 * @author peikunkun
 * @version V1.0
 * @date 2020-11-14 17:58
 **/
@ComponentScan(basePackages = "com.pkk.penguin.frame.know.java.driven.ext.listener")
public class ApplicationListenerManinTests {


  @Test
  public void Administrator_17_20201114175932_() {
    System.out.println("欢迎使用单元测试方法【Administrator_17()_20201114175932】");
    System.out.println("此方法测试描述：【】");

    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(
        ApplicationListenerManinTests.class);

    applicationContext.publishEvent(new MyApplicationListener());
    applicationContext.publishEvent(new MyEvent1(new String("测试的哦")));

    applicationContext.close();
  }
}
